.class public Lcom/instagram/android/q/f;
.super Ljava/lang/Object;
.source "RealtimeUpdateController.java"

# interfaces
.implements Lcom/instagram/android/x/h;
.implements Lcom/instagram/realtimeclient/RealtimeEventHandler;


# static fields
.field private static final a:Ljava/lang/String;


# instance fields
.field private b:Lcom/instagram/realtimeclient/RealtimeClient;

.field private c:Lcom/instagram/android/q/d;

.field private d:Lcom/instagram/android/q/h;

.field private e:Lcom/facebook/b/a/j;

.field private f:Lcom/instagram/realtimeclient/RealtimeEventHandler$Status;

.field private g:Lcom/instagram/android/q/a;

.field private final h:Lcom/instagram/realtimeclient/RealtimeOperationManager;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 46
    const-class v0, Lcom/instagram/android/q/f;

    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/instagram/android/q/f;->a:Ljava/lang/String;

    return-void
.end method

.method private constructor <init>()V
    .locals 2

    .prologue
    .line 65
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 56
    new-instance v0, Lcom/instagram/realtimeclient/RealtimeOperationManager;

    new-instance v1, Lcom/instagram/android/q/g;

    invoke-direct {v1, p0}, Lcom/instagram/android/q/g;-><init>(Lcom/instagram/android/q/f;)V

    invoke-direct {v0, v1}, Lcom/instagram/realtimeclient/RealtimeOperationManager;-><init>(Lcom/instagram/realtimeclient/RealtimeOperationManager$Listener;)V

    iput-object v0, p0, Lcom/instagram/android/q/f;->h:Lcom/instagram/realtimeclient/RealtimeOperationManager;

    .line 66
    return-void
.end method

.method synthetic constructor <init>(Lcom/instagram/android/q/g;)V
    .locals 0
    .parameter

    .prologue
    .line 30
    invoke-direct {p0}, Lcom/instagram/android/q/f;-><init>()V

    return-void
.end method

.method public static a()Lcom/instagram/android/q/f;
    .locals 1

    .prologue
    .line 96
    sget-object v0, Lcom/instagram/android/q/i;->a:Lcom/instagram/android/q/f;

    return-object v0
.end method

.method static synthetic a(Lcom/instagram/android/q/f;)Lcom/instagram/realtimeclient/RealtimeClient;
    .locals 1
    .parameter

    .prologue
    .line 30
    iget-object v0, p0, Lcom/instagram/android/q/f;->b:Lcom/instagram/realtimeclient/RealtimeClient;

    return-object v0
.end method

.method static synthetic b(Lcom/instagram/android/q/f;)Lcom/instagram/realtimeclient/RealtimeOperationManager;
    .locals 1
    .parameter

    .prologue
    .line 30
    iget-object v0, p0, Lcom/instagram/android/q/f;->h:Lcom/instagram/realtimeclient/RealtimeOperationManager;

    return-object v0
.end method

.method static synthetic c(Lcom/instagram/android/q/f;)Lcom/instagram/android/q/d;
    .locals 1
    .parameter

    .prologue
    .line 30
    iget-object v0, p0, Lcom/instagram/android/q/f;->c:Lcom/instagram/android/q/d;

    return-object v0
.end method


# virtual methods
.method public a(Landroid/content/Context;Lcom/facebook/b/a/k;Lcom/instagram/android/q/a;)V
    .locals 3
    .parameter
    .parameter
    .parameter

    .prologue
    .line 71
    new-instance v0, Lcom/instagram/android/q/d;

    invoke-direct {v0}, Lcom/instagram/android/q/d;-><init>()V

    iput-object v0, p0, Lcom/instagram/android/q/f;->c:Lcom/instagram/android/q/d;

    .line 72
    new-instance v0, Lcom/instagram/android/q/h;

    const/4 v1, 0x0

    invoke-direct {v0, p0, v1}, Lcom/instagram/android/q/h;-><init>(Lcom/instagram/android/q/f;Lcom/instagram/android/q/g;)V

    iput-object v0, p0, Lcom/instagram/android/q/f;->d:Lcom/instagram/android/q/h;

    .line 73
    invoke-virtual {p2}, Lcom/facebook/b/a/k;->a()Lcom/facebook/b/a/i;

    move-result-object v0

    const-string v1, "AuthHelper.BROADCAST_USER_CHANGED"

    iget-object v2, p0, Lcom/instagram/android/q/f;->d:Lcom/instagram/android/q/h;

    invoke-interface {v0, v1, v2}, Lcom/facebook/b/a/i;->a(Ljava/lang/String;Lcom/facebook/d/a;)Lcom/facebook/b/a/i;

    move-result-object v0

    invoke-interface {v0}, Lcom/facebook/b/a/i;->a()Lcom/facebook/b/a/j;

    move-result-object v0

    iput-object v0, p0, Lcom/instagram/android/q/f;->e:Lcom/facebook/b/a/j;

    .line 77
    iget-object v0, p0, Lcom/instagram/android/q/f;->e:Lcom/facebook/b/a/j;

    invoke-interface {v0}, Lcom/facebook/b/a/j;->b()V

    .line 79
    new-instance v0, Lcom/instagram/realtimeclient/RealtimeClient;

    invoke-direct {v0, p1}, Lcom/instagram/realtimeclient/RealtimeClient;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/instagram/android/q/f;->b:Lcom/instagram/realtimeclient/RealtimeClient;

    .line 80
    iget-object v0, p0, Lcom/instagram/android/q/f;->b:Lcom/instagram/realtimeclient/RealtimeClient;

    invoke-virtual {v0, p0}, Lcom/instagram/realtimeclient/RealtimeClient;->setEventHandler(Lcom/instagram/realtimeclient/RealtimeEventHandler;)V

    .line 82
    invoke-static {}, Lcom/instagram/android/activity/e;->a()Lcom/instagram/android/activity/e;

    move-result-object v0

    .line 83
    invoke-static {}, Lcom/instagram/android/x/q;->a()Lcom/instagram/android/x/q;

    move-result-object v1

    .line 84
    invoke-virtual {v0, v1}, Lcom/instagram/android/activity/e;->a(Lcom/instagram/android/activity/d;)V

    .line 85
    invoke-virtual {v1, p0}, Lcom/instagram/android/x/q;->a(Lcom/instagram/android/x/h;)V

    .line 87
    sget-object v0, Lcom/instagram/realtimeclient/RealtimeEventHandler$Status;->NOT_CONNECTED:Lcom/instagram/realtimeclient/RealtimeEventHandler$Status;

    iput-object v0, p0, Lcom/instagram/android/q/f;->f:Lcom/instagram/realtimeclient/RealtimeEventHandler$Status;

    .line 88
    iput-object p3, p0, Lcom/instagram/android/q/f;->g:Lcom/instagram/android/q/a;

    .line 89
    return-void
.end method

.method public a(Lcom/instagram/realtimeclient/RealtimePatchRange;)V
    .locals 1
    .parameter

    .prologue
    .line 104
    iget-object v0, p0, Lcom/instagram/android/q/f;->h:Lcom/instagram/realtimeclient/RealtimeOperationManager;

    invoke-virtual {v0, p1}, Lcom/instagram/realtimeclient/RealtimeOperationManager;->setPatchRange(Lcom/instagram/realtimeclient/RealtimePatchRange;)V

    .line 105
    return-void
.end method

.method public a(Lcom/instagram/realtimeclient/RealtimeSubscription;)V
    .locals 2
    .parameter

    .prologue
    .line 154
    if-nez p1, :cond_1

    .line 174
    :cond_0
    :goto_0
    return-void

    .line 159
    :cond_1
    invoke-static {}, Lcom/instagram/h/a;->b()Z

    move-result v0

    if-eqz v0, :cond_2

    invoke-static {}, Lcom/instagram/j/a/a;->a()Lcom/instagram/j/a/a;

    move-result-object v0

    invoke-virtual {v0}, Lcom/instagram/j/a/a;->j()Z

    move-result v0

    if-nez v0, :cond_0

    .line 164
    :cond_2
    invoke-static {}, Lcom/instagram/service/a;->a()Lcom/instagram/service/a;

    move-result-object v0

    .line 165
    invoke-static {}, Lcom/instagram/android/x/q;->a()Lcom/instagram/android/x/q;

    move-result-object v1

    .line 167
    invoke-virtual {v0}, Lcom/instagram/service/a;->d()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-virtual {v1}, Lcom/instagram/android/x/q;->b()Z

    move-result v0

    if-nez v0, :cond_0

    .line 172
    iget-object v0, p0, Lcom/instagram/android/q/f;->b:Lcom/instagram/realtimeclient/RealtimeClient;

    invoke-virtual {v0, p1}, Lcom/instagram/realtimeclient/RealtimeClient;->setSubscription(Lcom/instagram/realtimeclient/RealtimeSubscription;)V

    .line 173
    iget-object v0, p0, Lcom/instagram/android/q/f;->b:Lcom/instagram/realtimeclient/RealtimeClient;

    invoke-virtual {v0}, Lcom/instagram/realtimeclient/RealtimeClient;->subscribe()V

    goto :goto_0
.end method

.method public a(Ljava/util/Map;)V
    .locals 1
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Lcom/instagram/realtimeclient/RealtimePatchTuple;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 108
    iget-object v0, p0, Lcom/instagram/android/q/f;->h:Lcom/instagram/realtimeclient/RealtimeOperationManager;

    invoke-virtual {v0, p1}, Lcom/instagram/realtimeclient/RealtimeOperationManager;->handlePatches(Ljava/util/Map;)V

    .line 109
    return-void
.end method

.method public b()Lcom/instagram/realtimeclient/RealtimePatchRange;
    .locals 1

    .prologue
    .line 100
    iget-object v0, p0, Lcom/instagram/android/q/f;->h:Lcom/instagram/realtimeclient/RealtimeOperationManager;

    invoke-virtual {v0}, Lcom/instagram/realtimeclient/RealtimeOperationManager;->getPatchRange()Lcom/instagram/realtimeclient/RealtimePatchRange;

    move-result-object v0

    return-object v0
.end method

.method public c()V
    .locals 2

    .prologue
    .line 140
    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v0

    const-string v1, "onAppBackgrounded()"

    invoke-static {v0, v1}, Lcom/facebook/e/a/a;->a(Ljava/lang/Class;Ljava/lang/String;)V

    .line 141
    iget-object v0, p0, Lcom/instagram/android/q/f;->b:Lcom/instagram/realtimeclient/RealtimeClient;

    invoke-virtual {v0}, Lcom/instagram/realtimeclient/RealtimeClient;->unsubscribe()V

    .line 142
    return-void
.end method

.method public d()V
    .locals 2

    .prologue
    .line 146
    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v0

    const-string v1, "onAppForegrounded()"

    invoke-static {v0, v1}, Lcom/facebook/e/a/a;->a(Ljava/lang/Class;Ljava/lang/String;)V

    .line 147
    iget-object v0, p0, Lcom/instagram/android/q/f;->b:Lcom/instagram/realtimeclient/RealtimeClient;

    invoke-virtual {v0}, Lcom/instagram/realtimeclient/RealtimeClient;->subscribe()V

    .line 148
    return-void
.end method

.method public e()Lcom/instagram/realtimeclient/RealtimeEventHandler$Status;
    .locals 1

    .prologue
    .line 177
    iget-object v0, p0, Lcom/instagram/android/q/f;->f:Lcom/instagram/realtimeclient/RealtimeEventHandler$Status;

    return-object v0
.end method

.method public onConnectionStatusChanged(Lcom/instagram/realtimeclient/RealtimeEventHandler$Status;)V
    .locals 4
    .parameter "status"

    .prologue
    .line 117
    iput-object p1, p0, Lcom/instagram/android/q/f;->f:Lcom/instagram/realtimeclient/RealtimeEventHandler$Status;

    .line 118
    invoke-static {}, Lcom/instagram/h/a;->b()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 119
    sget-object v0, Lcom/instagram/android/q/f;->a:Ljava/lang/String;

    const-string v1, "Connection status: %s"

    const/4 v2, 0x1

    new-array v2, v2, [Ljava/lang/Object;

    const/4 v3, 0x0

    aput-object p1, v2, v3

    invoke-static {v1, v2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/facebook/e/a/a;->b(Ljava/lang/String;Ljava/lang/String;)V

    .line 120
    iget-object v0, p0, Lcom/instagram/android/q/f;->g:Lcom/instagram/android/q/a;

    invoke-virtual {v0, p1}, Lcom/instagram/android/q/a;->a(Lcom/instagram/realtimeclient/RealtimeEventHandler$Status;)V

    .line 122
    :cond_0
    return-void
.end method

.method public onFeedRefreshRequested()V
    .locals 1

    .prologue
    .line 131
    iget-object v0, p0, Lcom/instagram/android/q/f;->c:Lcom/instagram/android/q/d;

    invoke-virtual {v0}, Lcom/instagram/android/q/d;->a()V

    .line 132
    return-void
.end method

.method public onPatchEvent(Lcom/instagram/realtimeclient/RealtimePatchEvent;)V
    .locals 1
    .parameter "patchEvent"

    .prologue
    .line 126
    iget-object v0, p0, Lcom/instagram/android/q/f;->h:Lcom/instagram/realtimeclient/RealtimeOperationManager;

    invoke-virtual {v0, p1}, Lcom/instagram/realtimeclient/RealtimeOperationManager;->handlePatchEvent(Lcom/instagram/realtimeclient/RealtimePatchEvent;)V

    .line 127
    return-void
.end method
